3.5.26 \(\int \sec (c+d x) (a+b \tan ^2(c+d x)) \, dx\) [426]

Optimal. Leaf size=42 \[ \frac {(2 a-b) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \sec (c+d x) \tan (c+d x)}{2 d} \]

[Out]

1/2*(2*a-b)*arctanh(sin(d*x+c))/d+1/2*b*sec(d*x+c)*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3757, 393, 212} \begin {gather*} \frac {(2 a-b) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \tan (c+d x) \sec (c+d x)}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + b*Tan[c + d*x]^2),x]

[Out]

((2*a - b)*ArcTanh[Sin[c + d*x]])/(2*d) + (b*Sec[c + d*x]*Tan[c + d*x])/(2*d)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 3757

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \sec (c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a-(a-b) x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b \sec (c+d x) \tan (c+d x)}{2 d}+\frac {(2 a-b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{2 d}\\ &=\frac {(2 a-b) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 48, normalized size = 1.14 \begin {gather*} \frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {b \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \sec (c+d x) \tan (c+d x)}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + b*Tan[c + d*x]^2),x]

[Out]

(a*ArcTanh[Sin[c + d*x]])/d - (b*ArcTanh[Sin[c + d*x]])/(2*d) + (b*Sec[c + d*x]*Tan[c + d*x])/(2*d)

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 67, normalized size = 1.60

method result size
derivativedivides \(\frac {b \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(67\)
default \(\frac {b \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(67\)
risch \(-\frac {i b \left ({\mathrm e}^{3 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b}{2 d}\) \(118\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(b*(1/2*sin(d*x+c)^3/cos(d*x+c)^2+1/2*sin(d*x+c)-1/2*ln(sec(d*x+c)+tan(d*x+c)))+a*ln(sec(d*x+c)+tan(d*x+c)
))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 62, normalized size = 1.48 \begin {gather*} \frac {{\left (2 \, a - b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - b\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, b \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/4*((2*a - b)*log(sin(d*x + c) + 1) - (2*a - b)*log(sin(d*x + c) - 1) - 2*b*sin(d*x + c)/(sin(d*x + c)^2 - 1)
)/d

________________________________________________________________________________________

Fricas [A]
time = 2.52, size = 76, normalized size = 1.81 \begin {gather*} \frac {{\left (2 \, a - b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, b \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/4*((2*a - b)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (2*a - b)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*b*si
n(d*x + c))/(d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*sec(c + d*x), x)

________________________________________________________________________________________

Giac [A]
time = 0.60, size = 64, normalized size = 1.52 \begin {gather*} \frac {{\left (2 \, a - b\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (2 \, a - b\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, b \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/4*((2*a - b)*log(abs(sin(d*x + c) + 1)) - (2*a - b)*log(abs(sin(d*x + c) - 1)) - 2*b*sin(d*x + c)/(sin(d*x +
 c)^2 - 1))/d

________________________________________________________________________________________

Mupad [B]
time = 12.29, size = 79, normalized size = 1.88 \begin {gather*} \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a-b\right )}{d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x)^2)/cos(c + d*x),x)

[Out]

(atanh(tan(c/2 + (d*x)/2))*(2*a - b))/d + (b*tan(c/2 + (d*x)/2) + b*tan(c/2 + (d*x)/2)^3)/(d*(tan(c/2 + (d*x)/
2)^4 - 2*tan(c/2 + (d*x)/2)^2 + 1))

________________________________________________________________________________________